{% extends "_base.html" %}

{% block title %}用户管理 - 控制面板 - {{ handler.get_runtime_conf('title') }}{% end %}

{% block navs %}
{% module Template("admin/_navs.html", menu='admin') %}
{% end %}

{% block main %}
<div class="row">
    <div class="span12">
        <ul class="nav nav-tabs">
            {% module Template("admin/_tabs.html", menu = 'users') %}
        </ul>

        <ul class="breadcrumb">
            <li><a href="/admin"><i class="icon-th"></i> 控制面板</a> <span class="divider">/</span></li>
            <li class="active">用户管理</li>
        </ul>

        <table class="table table-hover table-striped table-bordered">
            <thead>
                <tr>
                    <th style="width: 60px">#</th>
                    <th>名称</th>
                    <th>邮箱</th>
                    <th>权限</th>
                    <th style="width: 160px">创建时间</th>
                    <th style="width: 160px">更新时间</th>
                    <th style="width: 80px">操作</th>
                </tr>
            </thead>
            <tbody>
                {% if users %}
                {% for user in users %}
                <tr>
                    <td>{{ user['user_id'] }}</td>
                    <td><a href="/@{{ user['user_name'] }}" target="_blank">{{ user['user_name'] }}</a></td>
                    <td>{{ user['user_mail'] }}</td>
                    <td>{{ user['user_perm'] }}</td>
                    <td>{{ handler.timer().strftime('%Y-%m-%d %H:%M:%S', handler.timer().localtime(user['user_ctms'])) }}</td>
                    <td>{{ handler.timer().strftime('%Y-%m-%d %H:%M:%S', handler.timer().localtime(user['user_utms'])) }}</td>
                    <td class="actor-block">
                        <a href="/admin/user?user_id={{ user['user_id'] }}">编辑</a>
                    </td>
                </tr>
                {% end %}
                {% else %}
                <tr>
                    <td colspan="7" style="text-align:center">没有发现内容</td>
                </tr>
                {% end %}
            </tbody>
        </table>

        {% module Template("admin/_page.html", pager=pager) %}
    </div>
</div>
{% end %}
